<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>关注的商品</title>
<jsp:include page="header.jsp"></jsp:include>

<script type="text/javascript">
			$(function(){
				$('.mem-sel input').click(function(){
					$('.mem-sel input').prop('checked',$(this).prop('checked'));
					$('.mem-all input').prop('checked',$(this).prop('checked'));
				});
				$('.mem-all input').click(function(){
					$('.mem-sel input').prop('checked',isAllSelected());
				});
				function isAllSelected(){
					var n = $('.mem-all input').length-1;
					var m=0;
					$('.mem-all input').each(function(index){
						if(!$(this).prop('checked')){return false;}
						m = index;
					});
					return m==n?true:false;
				}
			});
</script>
</head>
<body>
<div class="J-header"></div>
   <div class="wrap">
     	<div class="w member">
     	<div class="breadNavBg">
       <div class="breadNav pb10">
           <div><a>首页</a>&nbsp;&gt;&nbsp;</div><a href="member-index.jsp">会员中心</a>&nbsp;&gt;&nbsp;<span>我关注的商品</span>
       </div>
   </div><!--breadNavBg-->
        
         <div class="fl leftmenu">
         <h3 class="font14"><i class="arr"></i><b>会员中心</b><span>Member Center</span></h3>
            <ul>
                 <li class="title">采购中心</li>
                 <li><a href="ShowOrderServlet">我的采购单</a></li>
                 <li><a href="ShowMyOrderServlet">取消我的采购单</a></li>
            </ul>
            <ul>
                 <li class="title">代理中心</li>
                 <li><a href="member-agent-new.html">我的申请</a></li>
                 <li><a href="member-agent.html">我的代理</a></li>
            </ul>
            <ul>
			     <li class="title">关注中心</li>
			     <li class="active"><a href=ShowAttentionServlet>我关注的商品</a></li>
			     <li><a href="ShowShopServlet">我关注的店铺</a></li>
			</ul>
            <ul>
                 <li class="title">设置中心</li>
                 <li><a href="AccountServlet">账户信息</a></li>
                 <li><a href="AddressQueryServlet">收货地址</a></li>
                 <li><a href="member-setting-safe.jsp">账号安全</a></li>
            </ul>
      </div><!--leftmenu end-->
        <!-- 右侧内容 -->
        <div class="fr mem-con">
        	<h2>我关注的商品</h2>
        	<div class="mem-sel">
        		<div class="sel-all">
        			<input type="checkbox" name="" id="" value="" />全选
        		</div>
        		<div class="add-can">
        		
        			<a href="#">加入购物车</a>|
        			<a href="">取消关注</a>
        			
        		</div>
        	</div>
        	<div class="clearfix"></div>
        <div class="mem-all">
        		<ul>
        		<c:choose>
        			<c:when test="${empty page }">
        				你没有关注的商品
        			</c:when>
        			<c:otherwise>
        				<c:forEach items="${page.data }" var="p">
        				<li>
			       			<a class="p-img" href="/medicine/detailgoods?gid=${p.gid }"><img class="img" src="${p.fileName }"/></a>
			       			<div class="che-all">
			       				<input type="checkbox" name="" id="" value="" /><a href="">${p.summary }</a>
			       			</div>
			       			<span class="pri">￥${p.price }</span>
			       			<div class="add-cst">
			       				<a href="CartAdd?gid=${p.gid }" class="m-add">加入购物车</a>
			       				<a href="#" class="m-cst">对比</a>
			       				<a href="GoodsDeleteServlet?gaid=${p.gaid }" class="m-cle">取消</a>
			       			</div>
			       		</li>
        				</c:forEach>
        			</c:otherwise>
        		</c:choose>
        		</ul>
      	</div>
		        	<div class="clearfix"></div>
		        	<div class="mem-sel">
		        		<div class="sel-all">
		        			<input type="checkbox" name="" id="" value="" />全选
		        		</div>
		        		<div class="add-can">
		        			<a href="#">加入购物车</a>|
		        			<a href="">取消关注</a>
		        		</div>
		        		<div class="m-page">
		        			<ul>
		        			<c:if test="${page.pageIndex > 1 }">
		        				<li><a class="no-page" href="ShowAttentionServlet?nextPage=${page.pageIndex - 1 }">上一页</a></li>
		        			</c:if>
		        				<li><a href="ShowAttentionServlet?nextPage=1">1</a></li>
		        				<li><a href="ShowAttentionServlet?nextPage=2">2</a></li>
		        				<li><a href="ShowAttentionServlet?nextPage=3">3</a></li>
		        				<li><a href="ShowAttentionServlet?nextPage=4">4</a></li>
		        				<li>···</li>
		        			<c:if test="${page.pageIndex < page.totalPage}">
		        				<li><a href="ShowAttentionServlet?nextPage=${page.pageIndex + 1 }">下一页</a></li>
		        			</c:if>
		        			</ul>
		        		</div>
		        	</div>
		        </div>
		        <div class="clearfix"></div>
            	</div>
				
	        </div>
      <iframe src="footer.jsp" frameborder="0" width="100%" height="462" scrolling="no"></iframe>
</body>
</html>